# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=pmbootstrap
pkgver=2.1.0
pkgrel=0
pkgdesc="Sophisticated chroot/build/flash tool to develop and install postmarketOS"
url="https://sr.ht/~postmarketos/pmbootstrap/"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	git
	openssl
	python3
	"
makedepends="py3-setuptools"
checkdepends="pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~postmarketos/pmbootstrap/archive/$pkgver.tar.gz
	modules-load.conf
	"
install="$pkgname.post-install"
options="!check" # Tests require chroot etc.

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
	install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/pmbootstrap.conf
}

sha512sums="
b7e0283fef6560254907038d0304be52b0ef53a0b93728b1f72396e3bad5ce1ccd6cc69c7377d837f7e5e4823a75dc752e2835fa09d4efc0ce78dc601211d6b8  pmbootstrap-2.1.0.tar.gz
f8026ab32234b885e69252459047f70160c54319113bc449000aa7c05bd016f00a46cee05c8f5251682f967ab44a12c06fbbb3c02d0a57ccb836cff810ce1a40  modules-load.conf
"
